/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui.admin.staff;

import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author QuynhDu
 */
@ManagedBean
@RequestScoped
public class StaffStatus {

    /**
     * e a new instance of StaffStatus
     */
    int value;
    String display;

    public StaffStatus() {
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getDisplay() {
        return display;
    }

    public void setDisplay(String display) {
        this.display = display;
    }

    public StaffStatus(int value, String display) {
        this.value = value;
        this.display = display;
    }

    /**
     * @return List<StaffStatus>
     * @see list of status in a combobox
     */
    public List<StaffStatus> getAll() {
        ArrayList<StaffStatus> ls = new ArrayList<StaffStatus>();
        //ls.add(new StaffStatus(-1, "Deleted"));
        ls.add(new StaffStatus(0, "Candidate"));
        ls.add(new StaffStatus(1, "Activating"));
        return ls;
    }

    /**
     * @return String
     * @see string of status name
     */
    public String getDisplayString(int val) {
        for (StaffStatus object : getAll()) {
            if (object.getValue() == val) {
                return object.getDisplay();
            }
        }
        return null;
    }
}
